/**
 * <p>Copyright (c) 2017 深圳市鹏途交通科技有限公司 </p>
 * <p>				   All right reserved. 		     </p>
 * 
 * <p>项目名称 ： 	深圳市国省检日常化监管系统         </p>
 * <p>创建者   :	heyong 
 * 
 * <p>描   述  :   PolicyCriterion.java for com.pengtu.gsj.entity.jsbz    </p>
 * 
 * <p>最后修改 : $: 2017年8月9日-下午3:25:38 v 1.0.0	 heyong   $ </p>
 * 
*/

package com.pengtu.gsj.entity.jsbz;

import java.util.List;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.JoinColumn;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.persistence.Transient;

import com.pengtu.gsj.entity.app.Attachment;
import com.pengtu.gsj.entity.base.IdEntity;

/**
 * 
 * PolicyCriterion
 * 
 * 2017年8月9日 下午3:25:38
 * 
 * @version 1.0.0
 * 
 */
@Entity
@Table(name = "T_JS_POLICYCRITERION")
public class PolicyCriterion extends IdEntity {

	private static final long serialVersionUID = 8882171591431744672L;
	private String attmentName;					//文件名称
	private String attmentNo;					//文件编号
	private String attmentYear;					//年份
	private String remark;						//备注
	
	private Integer bulletinNumber;     //检测文件数
	private List<Attachment> attachments;
	
	@Column(name = "ATTMENTNAME")
	public String getAttmentName() {
		return attmentName;
	}

	public void setAttmentName(String attmentName) {
		this.attmentName = attmentName;
	}
	
	@Column(name = "ATTMENTNO")
	public String getAttmentNo() {
		return attmentNo;
	}

	public void setAttmentNo(String attmentNo) {
		this.attmentNo = attmentNo;
	}
	
	@Column(name = "ATTMENTYEAR")
	public String getAttmentYear() {
		return attmentYear;
	}

	public void setAttmentYear(String attmentYear) {
		this.attmentYear = attmentYear;
	}
	
	@Column(name = "REMARK")
	public String getRemark() {
		return remark;
	}

	public void setRemark(String remark) {
		this.remark = remark;
	}

	@Transient
	public Integer getBulletinNumber() {
		bulletinNumber = attachments.size();
		return bulletinNumber;
	}

	public void setBulletinNumber(Integer bulletinNumber) {
		this.bulletinNumber = bulletinNumber;
	}

	@OneToMany(fetch = FetchType.LAZY)
	@JoinColumn(name = "PARTID")
	public List<Attachment> getAttachments() {
		return attachments;
	}

	public void setAttachments(List<Attachment> attachments) {
		this.attachments = attachments;
	}
	
}
